package com.ruoyi.maode.controller;

import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.maode.domain.dto.DetectionResultDTO;
import com.ruoyi.maode.service.PartSizeService;
import com.ruoyi.web.core.config.ResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 零部件检测Controller
 *
 * @author zhangwenqiang
 */

@RestController
@RequestMapping("/partSize")
public class PartSizeController  extends BaseController {

    private static final Logger log = LoggerFactory.getLogger(PartController.class);

    @Autowired
    private PartSizeService partSizeService;

    @ApiOperation("获取零件检测数据")
    @GetMapping("/getPartSizeDetail/{id}/{type}/{partId}")
    public ResultDTO getPartSizeDetail(@PathVariable("id") Long id,@PathVariable("type")Integer type,@PathVariable("partId")Integer partId) {
        return ResultDTO.success(partSizeService.getPartSizeDetail(id,type,partId));
    }

    @ApiOperation("获取零件检测气泡图")
    @GetMapping("/getPartSizeImg/{partCode}")
    public ResultDTO getPartSizeImg(@PathVariable("partCode")String partCode) {
        return ResultDTO.success(partSizeService.getPartSizeImg(partCode));
    }

}
